package com.fyt.service.impl;

import com.fyt.service.htmlToPdfService;
import org.springframework.stereotype.Service;
/**
 * @author ：fyt
 * @date ：2024/02/26 16:09
 */
import java.io.IOException;

@Service
public class htmlToPdfServiceImpl implements htmlToPdfService {

    @Override
    public void htmlToPdf(String runAdd,String htmlName,String pdfName) {
        // 获取Runtime实例
        Runtime rt = Runtime.getRuntime();
        // 拼接命令
        String code = runAdd+" "+htmlName+" "+pdfName;
        try {
            rt.exec(code);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
